package org.theonept.travian.model;

import java.util.Arrays;

import org.theonept.travian.t4a.R;



public enum EnumRace {
	GERMAIN("nation2",R.drawable.germain), ROMAIN("nation1",R.drawable.romain), GAULOIS("nation3",R.drawable.gaulois);
	private String idRace;
	private int idImage;

	private EnumRace(String idRace,int image) {
		this.idImage = image;
		this.setIdRace(idRace);
	}

	public static EnumRace getRaceFromId(String id) {
		for (EnumRace race : Arrays.asList(EnumRace.values())) {
			if (id.contains(race.getIdRace())) {
				return race;
			}
		}
		return null;

	}
public int getIdImage() {
	return idImage;
}
	public String getIdRace() {
		return idRace;
	}

	public void setIdRace(String idRace) {
		this.idRace = idRace;
	}
}
